home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 002 / emacssrc.arc / EVAR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1987-02-02  |  3.0 KB  |  110 lines

  1. /*    EVAR.H:    Environment and user variable definitions
  2.  
  3.         for MicroEMACS
  4.  
  5.  
  6.  
  7.         written 1986 by Daniel Lawrence
  8.  
  9. */
  10.  
  11.  
  12.  
  13. /*    structure to hold user variables and their definitions    */
  14.  
  15.  
  16.  
  17. typedef struct UVAR {
  18.  
  19.     char u_name[NVSIZE + 1];        /* name of user variable */
  20.  
  21.     char *u_value;                /* value (string) */
  22.  
  23. } UVAR;
  24.  
  25.  
  26.  
  27. /*    current user variables (This structure will probably change)    */
  28.  
  29.  
  30.  
  31. #define    MAXVARS        100
  32.  
  33.  
  34.  
  35. UVAR uv[MAXVARS];    /* user variables */
  36.  
  37.  
  38.  
  39. /*    list of recognized environment variables    */
  40.  
  41.  
  42.  
  43. char *envars[] = {
  44.  
  45.     "fillcol",        /* current fill column */
  46.  
  47.     "pagelen",        /* number of lines used by editor */
  48.  
  49.     "curcol",        /* current column pos of cursor */
  50.  
  51.     "curline",        /* current line in file */
  52.  
  53.     "ram",            /* ram in use by malloc */
  54.  
  55.     "flicker",        /* flicker supression */
  56.  
  57.     "curwidth",        /* current screen width */
  58.  
  59.     "cbufname",        /* current buffer name */
  60.  
  61.     "cfname",        /* current file name */
  62.  
  63.     "sres",            /* current screen resolution */
  64.  
  65.     "debug",        /* macro debugging */
  66.  
  67.     "status",        /* returns the status of the last command */
  68.  
  69.     "palette",        /* current palette string */
  70.  
  71. };
  72.  
  73.  
  74.  
  75. #define    NEVARS    sizeof(envars) / sizeof(char *)
  76.  
  77.  
  78.  
  79. /*     and its preprocesor definitions        */
  80.  
  81.  
  82.  
  83. #define    EVFILLCOL    0
  84.  
  85. #define    EVPAGELEN    1
  86.  
  87. #define    EVCURCOL    2
  88.  
  89. #define    EVCURLINE    3
  90.  
  91. #define    EVRAM        4
  92.  
  93. #define    EVFLICKER    5
  94.  
  95. #define    EVCURWIDTH    6
  96.  
  97. #define    EVCBUFNAME    7
  98.  
  99. #define    EVCFNAME    8
  100.  
  101. #define    EVSRES        9
  102.  
  103. #define    EVDEBUG        10
  104.  
  105. #define    EVSTATUS    11
  106.  
  107. #define    EVPALETTE    12
  108.  
  109.  
  110.  
  111. /*    list of recognized user functions    */
  112.  
  113.  
  114.  
  115. typedef struct UFUNC {
  116.  
  117.     char *f_name;    /* name of function */
  118.  
  119.     int f_type;    /* 1 = monamic, 2 = dynamic */
  120.  
  121. } UFUNC;
  122.  
  123.  
  124.  
  125. #define    MONAMIC        1
  126.  
  127. #define    DYNAMIC        2
  128.  
  129. #define    TRINAMIC    3
  130.  
  131.  
  132.  
  133. UFUNC funcs[] = {
  134.  
  135.     "add", DYNAMIC,        /* add two numbers together */
  136.  
  137.     "sub", DYNAMIC,        /* subtraction */
  138.  
  139.     "tim", DYNAMIC,        /* multiplication */
  140.  
  141.     "div", DYNAMIC,        /* division */
  142.  
  143.     "mod", DYNAMIC,        /* mod */
  144.  
  145.     "neg", MONAMIC,        /* negate */
  146.  
  147.     "cat", DYNAMIC,        /* concatinate string */
  148.  
  149.     "lef", DYNAMIC,        /* left string(string, len) */
  150.  
  151.     "rig", DYNAMIC,        /* right string(string, pos) */
  152.  
  153.     "mid", TRINAMIC,    /* mid string(string, pos, len) */
  154.  
  155.     "not", MONAMIC,        /* logical not */
  156.  
  157.     "equ", DYNAMIC,        /* logical equality check */
  158.  
  159.     "les", DYNAMIC,        /* logical less than */
  160.  
  161.     "gre", DYNAMIC,        /* logical greater than */
  162.  
  163.     "seq", DYNAMIC,        /* string logical equality check */
  164.  
  165.     "sle", DYNAMIC,        /* string logical less than */
  166.  
  167.     "sgr", DYNAMIC,        /* string logical greater than */
  168.  
  169.     "ind", MONAMIC,        /* evaluate indirect value */
  170.  
  171. };
  172.  
  173.  
  174.  
  175. #define    NFUNCS    sizeof(funcs) / sizeof(char *)
  176.  
  177.  
  178.  
  179. /*     and its preprocesor definitions        */
  180.  
  181.  
  182.  
  183. #define    UFADD        0
  184.  
  185. #define    UFSUB        1
  186.  
  187. #define    UFTIMES        2
  188.  
  189. #define    UFDIV        3
  190.  
  191. #define    UFMOD        4
  192.  
  193. #define    UFNEG        5
  194.  
  195. #define    UFCAT        6
  196.  
  197. #define    UFLEFT        7
  198.  
  199. #define    UFRIGHT        8
  200.  
  201. #define    UFMID        9
  202.  
  203. #define    UFNOT        10
  204.  
  205. #define    UFEQUAL        11
  206.  
  207. #define    UFLESS        12
  208.  
  209. #define    UFGREATER    13
  210.  
  211. #define    UFSEQUAL    14
  212.  
  213. #define    UFSLESS        15
  214.  
  215. #define    UFSGREAT    16
  216.  
  217. #define    UFIND        17
  218.  
  219.